<?php

abstract class fvLayoult {
    
    protected $_title;
    protected $_keywords;
    protected $_description;
    protected $_templateName;
    protected $_moduleResult;
    
    public function __construct($templateName) {
        $this->_templateName = $templateName;
    }
    
    public function getTitle() {
        return $this->_title;
    }
    
    public function getKeywords() {
        return $this->_keywords;
    }
    
    public function getDescription() {
        return $this->_description;
    }
    
    public function setTitle($title) {
        $this->_title = $title;
    }
    
    public function setKeywords($keywords) {
        $this->_keywords = $keywords;
    }
    
    public function setDescription($description) {
        $this->_description = $description;
    }

    public function setTemplate($templateName) {
        $this->_templateName = $templateName;
    }
    
    public function showPage() {
        if (!is_null($this->_templateName)) {
            fvSite::$Template->assign(array(
                'currentPage' => $this,
            ));
//            var_dump($this);
            return fvSite::$Template->fetch($this->_templateName);
        } else return $this->getPageContent();
    }
    
    public function setModuleResult($result) {
        $this->_moduleResult = $result;
    }
    
    public function getModuleResult() {
        return $this->_moduleResult;
    }
    
    public function getLoggedUser() {
        return fvSite::$fvSession->getUser();
    }
    
    abstract public function getPageContent();
}

?>
